package hk.ust.cse;

import java.util.Scanner;

public class Main {
	
	/**
	 * Main class!!
	 * 
	 * Do not test the Main method!!!!
	 * There is no bugs in here!
	 * 
	 * 
	 * This is just one possible usage of Rectangle class
	 * 
	 * @param args
	 */
	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);
		Rectangle r = null;

		do{

			System.out.println("Please enter width ");
			int width= scanner.nextInt();

			System.out.println("Please enter height");
			int height = scanner.nextInt();

			System.out.println("Please enter name");
			String name = scanner.nextLine();
			
			r = new Rectangle(name, width, height);

		}while(!r.isValidInput()); //if the input is invalid repeat the data acquisition
		scanner.close();

		//PRINT VALUES
		System.out.println("The width and height of rectangle "+ r.name + ":" + r.w +", "+r.h);
		System.out.println("Perimeter: "+r.getPerimeter());
		System.out.println("Is it a square rectangle ? : " + r.isSquare());

	}

}
